<?php

namespace IDock\Insurance\JDAL\Request;

use IDock\Insurance\JDAL\Response\VehicleModelResponse;
use IDock\Visitor\VehicleModelVisitor;

class VehicleModelRequest extends AllJDALRequest
{
    public $route = 'quote/vehicleQuery';

    public $requestCode = 'vehicleQueryRequest';

    protected $response = VehicleModelResponse::class;

    protected $urlTip = '车型查询';

    /*** @var  VehicleModelVisitor $visitor */
    protected $visitor;

    public function generate(): array
    {
        $this->partnerRef = $this->visitor->argc['channelCode'] ?? '';

        return [
            'orderId' => '',
            'pageIndex' => 0,
            'pageSize' => 100,
            'vehicle' => [
                'branchCode' => $this->visitor->argc['comCode'] ?? '',
                'vinNo' => $this->visitor->vin,
                'licensePlateNo' => $this->visitor->licenseNo,
                'licensePlateType' => '',
                'ecdemicVehicleFlag' => '',
                'newVehicle' => $this->visitor->licenseNo ? '0' : '1',
                'partnerRef' => $this->partnerRef,
                'engineNo' => $this->visitor->licenseNo,
                'bodyType' => $this->visitor->vehicleModel
            ]
        ];

    }
}
